/**
 * Licensee: Universidad del Pais Vasco
 * License Type: Academic
 */
package ormsamples;

import org.orm.*;
public class DeleteTraductorData {
	public void deleteTestData() throws PersistentException {
		PersistentTransaction t = orm.TraductorPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.Palabra lormPalabra = orm.PalabraDAO.loadPalabraByQuery(null, null);
			// Delete the persistent object
			orm.PalabraDAO.delete(lormPalabra);
			orm.Usuarios lormUsuarios = orm.UsuariosDAO.loadUsuariosByQuery(null, null);
			// Delete the persistent object
			orm.UsuariosDAO.delete(lormUsuarios);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			DeleteTraductorData deleteTraductorData = new DeleteTraductorData();
			try {
				deleteTraductorData.deleteTestData();
			}
			finally {
				orm.TraductorPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
